<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="autor" content="Breezy New Media (info@breezy.cz)" />
<meta name="copyright" content="PointSpace - free website layout 2008" />
<meta name="description" content=""  />
<meta name="keywords" content="" />
<title>Advanced Databases TUE - Search Artist</title>
<link rel="stylesheet" type="text/css" href="./css/default.css" media="screen" />
<link rel="stylesheet" type="text/css" href="./css/print.css" media="print" />
</head>
<f:view>
<body>

<div id="view">
  <div id="head">
    <div id="logo">
      <a href="" class="block">&nbsp;</a>
      <h1><a href="index.html">advanced<span>Databases</span></a></h1>
      <h2><a href="index.html">the music you are looking for..!</a></h2>
    </div>
    <hr class="hidden" />
    
    <jsp:include page="userMenu.jsp"/>
    
    <hr class="hidden" />
  </div>
  
  <div id="content">
    <div id="contentBlock" style="height:100%;">
      <div class="item last">
      </div>
      <div class="col1" style="width:600px;height:100%">
        <div class="item">
          <h3>Artist Search</h3>
			<h:form>
				<table>
					<tr>
						<td>
							<h:inputText styleClass="button" size="60" value="#{artistSearchEngineBean.artistToSearch}"></h:inputText>
						</td>
					</tr>
					<tr>
						<td>
							<h:commandButton styleClass="submit" action="#{artistSearchEngineBean.searchArtists}" value="Search"></h:commandButton>
						</td>
					</tr>
				</table>
			</h:form>
			<f:subview id="admin3" rendered="#{loginManagerBean.isAdmin}">
		      	   <h:form>
						<h:commandLink styleClass="add" title="Add Artist" action="#{artistSearchEngineBean.accessAddArtist}">
							<h:graphicImage style="padding-left:2px;margin:0px;vertical-align:bottom;"  value="images/ico/add.gif"></h:graphicImage>
						</h:commandLink>
		      	   </h:form>
	      	</f:subview>
        </div>
        <div class="item last">
			<div>
				<h:form>
				<t:dataTable newspaperColumns="2" newspaperOrientation="horizontal" style="margin:0;padding-bottom:0px" value="#{artistSearchEngineBean.artists}" var="item">
					<h:column>
						<table style="padding:0;vertical-align:top">
							<tr>
								<td width="110px">
									<div class="img-shadow" style="width:70px">
										<h:graphicImage value="#{item.image}" width="70px" height="70px"/>
									</div>	
								</td>
								<td>
									<b>Artist: </b><h:commandLink value="#{item.name}" action="artistInfo">
										<f:param name="artistKey" value="#{item.id}"></f:param>
									</h:commandLink>
									<p/>
									<b>Rating: </b><h:graphicImage style="border:0;vertical-align:bottom" value="images/ico/rating_.#{item.rating}.gif"></h:graphicImage>
									<br/>
									<f:subview id="admin1" rendered="#{loginManagerBean.isAdmin}">
										<h:commandLink styleClass="edit" title="Edit" action="#{artistSearchEngineBean.editArtist}">
											<h:graphicImage style="margin:0px;vertical-align:bottom;"  value="images/ico/edit.png"></h:graphicImage>
											<f:param name="artistKey" value="#{item.id}"></f:param>
										</h:commandLink>
									</f:subview>									
									<f:subview id="admin" rendered="#{loginManagerBean.isAdmin}">
										<h:commandLink styleClass="remove" title="Remove" action="#{artistSearchEngineBean.removeArtist}">
											<h:graphicImage style="padding-left:2px;margin:0px;vertical-align:bottom;"  value="images/ico/delete.png"></h:graphicImage>
											<f:param name="artistKey" value="#{item.id}"></f:param>
										</h:commandLink>
									</f:subview>
									<f:subview id="admin2" rendered="#{loginManagerBean.isAdmin}">
										<h:commandLink styleClass="add" title="Add Album" action="#{albumSearchEngineBean.accessAddAlbum}">
											<h:graphicImage style="padding-left:2px;margin:0px;vertical-align:bottom;"  value="images/ico/add_album.png"></h:graphicImage>
											<f:param name="artistKey" value="#{item.id}"></f:param>
										</h:commandLink>
									</f:subview>
								</td>
							</tr>							
						
						</table>						
					</h:column>
				</t:dataTable>	
				</h:form>
			</div>            
        </div>
      </div>
      <!-- /#cols 50:50 -->
      
    </div>
    <hr class="hidden" />
        <div id="menuBlock">
	      <div class="box boxText">
      	<h3>RSS Feeds</h3>
          	<div style="position:relative">
          		<a title="RSS Feed" href="http://localhost:8080/exist/ad/rssTopRatedArtists.xql"><img src="images/ico/rss16x16.png"></a><strong> Top Rated Artists</strong>
          	</div>	      
        	<br/> 
         <h3>Top Artists</h3>
	        	<div style="position:relative;margin-left:0px">
						<h:form>
						<t:dataTable newspaperColumns="1" newspaperOrientation="horizontal" style="border:0px" value="#{musicProfileEngineBean.topRatedArtists}" var="item">
								<h:column>
									<table style="padding:0;vertical-align:top">
										<tr>
											<td width="110px">
												<div class="img-shadow" style="width:70px">
													<h:graphicImage value="#{item.image}" width="70px" height="70px"/>
												</div>	
											</td>
											<td>
												<h:commandLink value="#{item.name}" action="artistInfo">
													<f:param name="artistKey" value="#{item.id}"></f:param>
												</h:commandLink>
												<p/>
												<b>Rating: </b><h:graphicImage style="border:0;vertical-align:bottom" value="images/ico/rating_.#{item.rating}.gif"></h:graphicImage>
												<br/>
											</td>
										</tr>							
									
									</table>	
								</h:column>
						</t:dataTable>
						</h:form>        
	        	</div>    	          
	      </div>
   		</div>
    </div>
  
  
  
  <hr class="hidden" />
  <ul class="hidden">
    <li><a href="#view"></a></li>
    <li><a href="#content"></a></li>
  </ul>
  <hr class="hidden" />
  
  <div id="foot">
    <p class="fl">&copy; all rights reserved</p>
    
    
    
    <!-- /#   LINKS AND AUTHOR-SIGNATURE CANNOT BE REMOVED !!! -->
    <p class="fr"><a href="www.tue.nl" title="See more ON">TUE</a> created by <a href="http://www.tue.nl" class="ico ico-breezy">TUE</a></p>
  </div>
</div>

</body>
</f:view>
</html>
